Skip to content

Fix WiFi.persistent(false); having no effect. #1406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 14, 2018
Merged

Fix WiFi.persistent(false); having no effect. #1406

merged 1 commit into from
May 14, 2018

Conversation

everslick
Copy link
Contributor

This PR calls esp_wifi_set_storage(WIFI_STORAGE_RAM); when persistent WiFi configuration is not desired.

according to the ESP32 API reference guide the default is to store WiFi configuration in NVS.

esp_err_t esp_wifi_set_storage(wifi_storage_tstorage)
Set the WiFi API configuration storage type.

Attention

  1. The default value is WIFI_STORAGE_FLASH

  This PR calls `esp_wifi_set_storage(WIFI_STORAGE_RAM);` when
  persistent WiFi configuration is not desired.
@stickbreaker
Copy link
Contributor

@everslick if you set persistent=false, does it erase the previously stored credentials? Or does it just not store the next presented credentials?

Chuck

@everslick
Copy link
Contributor Author

To my understanding, it will not erase the config that is already stored in NVS. There is a esp_wifi_restore() function, that will reset the config to its defaults, but this is never used.

Personally I'd prefer if the ESP32 would only do what it is told to. i.e. NOW connect to SSID, NOW start AP, NOW disconnect from SSID, NOW disable AP. Never store anything in NVS on your own, never connect to anything on your own. But from the API it is hard to deduce which call to which methods in which order will do that.

@me-no-dev me-no-dev merged commit 0ea9ea4 into espressif:master May 14, 2018
@tablatronix
Copy link
Contributor

Going to move these to #1393

Curclamas pushed a commit to Curclamas/arduino-esp32 that referenced this pull request Aug 21, 2018
This PR calls `esp_wifi_set_storage(WIFI_STORAGE_RAM);` when
  persistent WiFi configuration is not desired.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants